package com.kk.base.entity.admin;

import com.kk.base.annotion.ValidateEntity;
import com.kk.base.entity.BaseEntity;
import com.kk.base.entity.home.ExpressMailOrder;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;

/**
 * 收揽派送
 */
@Entity
@Table(name="buy_off")
@EntityListeners(AuditingEntityListener.class)
@ToString
@Data
public class BuyOff extends BaseEntity {

    public static final int CONFIRMRECEIPT = 0; //确认收货
    public static final int CONFIRM_THE_DELIVERY = 1; //准备派送
    public static final int DESIGNATE_DISPATCHERS = 2; //指定派送员
    public static final int SEND_COMPLETE = 3;  //派送完成

    @ManyToOne
    @JoinColumn(name="buy_off_user_id")
    @ValidateEntity(required=true,errorRequiredMsg="用户不能为空!")
    private User buyOffUser;

    @ManyToOne
    @JoinColumn(name="buy_off_express_mail_order_id")
    @ValidateEntity(required=true,errorRequiredMsg="订单不能为空!")
    private ExpressMailOrder buyOffExpressMailOrder;

    @Column(name="status")
    @ValidateEntity(required=true,errorRequiredMsg="状态不能为空!")
    private Integer status;

    @Column(name = "operation")
    @ValidateEntity(required=true,errorRequiredMsg="操作状态不能为空!")
    private Integer operation = ProcessRecords.NO_OPERATIONS;


}
